< previous page page_601 next page >

Page 601
9f31265bb40b592b1929e18a47ab28e5.gif
   ' Get Value From Registry
   mstrKeyValue = GetSetting(mstrConfigName, _
                           mstrSection, _
                           mstrKeyName, _
                           strDefault)

   KeyGet = mstrKeyValue
End Function
Using the Registry Class to Save Data
When you fill in the Key Value text box with a different value and then click the Save W/Class command button in the sample form, you save the data back to the Registry. The Click event for this command button instantiates an instance of the Registry class. Set the values from the text boxes and then invoke the KeySave() method to retrieve the data:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdRegClassSet_Click()
   Dim oReg As Registry

   Set oReg = New Registry
   With oReg
      .ConfigName = txtConfig
      .Section = txtSection
      .KeyName = txtKeyName
      .KeyValue = Trim$(txtKeyValue)
      .KeySave
   End With

   '***************************************
   '* Alternate Method
   '***************************************
   'With oReg
   '   .KeySave txtKeyValue, _
   '           txtSection, _
   '           txtKeyName
   'End With

   Set oReg = Nothing
End Sub

 
< previous page page_601 next page >

If you like this book, buy it!